import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 客户地址信息信息 */
export interface MemberAddress {
          id: number; // ID
          buildNo: string; // 楼栋号
          floorNo?: string; // 楼层号
          houseNo?: string; // 门牌号
          sort?: number; // 排序
  }

// 客户地址信息 API
export const MemberAddressApi = {
  // 查询客户地址信息分页
  getMemberAddressPage: async (params: any) => {
    return await request.get({ url: `/rbt/member-address/page`, params })
  },

  // 查询客户地址信息详情
  getMemberAddress: async (id: number) => {
    return await request.get({ url: `/rbt/member-address/get?id=` + id })
  },

  // 新增客户地址信息
  createMemberAddress: async (data: MemberAddress) => {
    return await request.post({ url: `/rbt/member-address/create`, data })
  },

  // 修改客户地址信息
  updateMemberAddress: async (data: MemberAddress) => {
    return await request.put({ url: `/rbt/member-address/update`, data })
  },

  // 删除客户地址信息
  deleteMemberAddress: async (id: number) => {
    return await request.delete({ url: `/rbt/member-address/delete?id=` + id })
  },

  /** 批量删除客户地址信息 */
  deleteMemberAddressList: async (ids: number[]) => {
    return await request.delete({ url: `/rbt/member-address/delete-list?ids=${ids.join(',')}` })
  },

  // 导出客户地址信息 Excel
  exportMemberAddress: async (params) => {
    return await request.download({ url: `/rbt/member-address/export-excel`, params })
  }
}